/*
 * @Author: 0x9DEFA478
 * @Date: 2021-08-21 19:58:33
 * @LastEditTime: 2021-09-29 13:57:02
 * @LastEditors: 0x9DEFA478
 * @Description: 
 * QQ:2652450237
 * ============================================================================================================================================
 * 
 * 
 * 
 *                                                                                               ************      ****************************
 *                                                                                             ************      ****************************  
 *                                                                                           ************      ****************************    
 *                                                                                         ************      ****************************      
 *                                                                                       ************      ************                        
 *                                                                                     ************      ************                          
 *                                                                                   ************      ************                            
 *                                                                                 ************      ************                              
 *                                                                               ************      ************                                
 *                                                                             ************      ************                                  
 *                                                                           ************      ************                                    
 *                                                                         ************      ************                                      
 *                                                                       ************      ************                                        
 *                                                                     ************      ************                                          
 *                                                                   ************      ************                                            
 *                                                                 ************      ************                                              
 *                                                               ************      ************                                                
 *                                                             ************      ************                                                  
 *                                                           ************      ************                                                    
 *                                                         ************      ************                                                      
 *                                                       ************      ************                                                        
 *                                                     ************      ************                                                          
 *                                                   ************      ************                                                            
 *                                                 ************      ************                                                              
 *                                               ************      ************                                                                
 *                                             ************      ************                                                                  
 *                                           ************      ************                                                                    
 *                                         ************      ************                                                                      
 *                                       ************      ************                                                                        
 *                                     ************      ************                                                                          
 *                                   ************      ************                                                                            
 *                                 ************      ************                                                                              
 *                               ************      ************                                                                                
 *                             ************      ************                                                                                  
 *                           ************      ************                                                                                    
 *                         ************      ************                                                                                      
 *       ****************************      ************                                                                                        
 *     ****************************      ************                                                                                          
 *   ****************************      ************                                                                                            
 * ****************************      ************                                                                                              
 * 
 * 
 * 
 * ============================================================================================================================================
 * 
 */
#include "H_ThreadScheduler_Core.h"
#include "H_ThreadScheduler_LL.h"

extern H_TS* volatile H_TS_Core;


extern void* H_TS_StartFirstThread;
extern void* volatile * volatile H_TS_RunThreadPtr;
extern void* H_TS_PendSV_Call;


/**
 * @brief 底层初始化
 * 根据平台修改
 * @return 无
 */
void H_TS_LL_Init(){
  //该方法在开始调度时被调用

  //FPU->FPCCR|=FPU_FPCCR_ASPEN_Msk|FPU_FPCCR_LSPEN_Msk;//使能control自动设置与fpu惰性压栈
  HAL_NVIC_SetPriority(PendSV_IRQn, 15U, 0U);//设置PendSV优先级为最低

  //H_TS内部配置 无需修改
  H_TS_PendSV_Call=(void*)&H_TS_StartFirstThread;
  H_TS_RunThreadPtr=H_TS_Core->ReadyThreads->StackPointer;
  H_TS_Core->RunThreadPtr=&H_TS_RunThreadPtr;
  
}

